#ifndef _RUNTIME_
#define _RUNTIME_
#include "Recovery.h"
#include <stdlib.h>
/*Store size bytes of *value's contents into the address NVAddr in NV Mem*/
extern "C" void STORE_NV(void *value, unsigned long NVAddr, size_t size);

/*Read size bytes from NV Mem addr NVAddr and put it in *buf*/
extern "C" void LOAD_NV(void *buf, unsigned long NVAddr, size_t size);

extern "C" void LD_CURR_CP_AFTER_RECOVERY_RTN( void *recoveryRtn );

extern "C" void GET_RECOVERY_ROUTINE( void *recoveryRtn );

extern "C" unsigned long GET_DEATH_ID();

extern "C" void SET_DEATH_ID(unsigned long);

extern "C" bool GET_FAILURE_BIT();

extern "C" void SET_FAILURE_BIT();

extern "C" void CLEAR_FAILURE_BIT();

extern "C" void TRY_BEGIN( unsigned tryNum );

extern "C" void TRY_END( unsigned tryNum );

extern "C" void STORE_EXPLICIT_CHECKPOINT( unsigned ckptNo );

#ifdef _WIN32
extern "C" void __cdecl STORE_EXPLICIT_CHECKPOINT_WITH_RECOVERY( unsigned ckptNo, Recovery *r );

extern "C" void __cdecl LOAD_EXPLICIT_CHECKPOINT( unsigned ckptNo );
#else
extern "C" void STORE_EXPLICIT_CHECKPOINT_WITH_RECOVERY( unsigned ckptNo, Recovery *r );

extern "C" void LOAD_EXPLICIT_CHECKPOINT( unsigned ckptNo );

#endif

extern "C" void LOAD_CURRENT_CHECKPOINT();
#endif
